/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package foxmob.mlts;

import foxmob.mlts.component.FileManager;
import foxmob.mlts.model.MultipleChoiceQuestion;
import foxmob.mlts.model.Section;
import foxmob.mlts.model.Question;
import foxmob.mlts.model.Subsection;
import foxmob.mlts.model.QuestionPaper;
import foxmob.mlts.viewcontroller.MainPage;
import java.io.IOException;
import java.util.ArrayList;

/**
 *
 * @author Lunayo
 */
public class FoxMobMLTS {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        
        //I think that our repository is working,
        //But we need to test it
        MultipleChoiceQuestion first = new MultipleChoiceQuestion();
        first.setQuestionText("Apples are ____");
        first.setPossibleAnswers(new String[]{"red","blue","short"});
        first.setCorrectAnswer(0);
        MultipleChoiceQuestion second = new MultipleChoiceQuestion();
        second.setQuestionText("I ____ a student in the UoM!");
        second.setPossibleAnswers(new String[]{"go","will","am"});
        second.setCorrectAnswer(2);
        MultipleChoiceQuestion third = new MultipleChoiceQuestion();
        third.setQuestionText("Manchester has a ____ climate.");
        third.setPossibleAnswers(new String[]{"cold","warm","dry"});
        third.setCorrectAnswer(1);
        ArrayList<Question> questions = new ArrayList<Question>();
        questions.add(first);
        questions.add(second);
        questions.add(third);
        Subsection firstSub = new Subsection();
        firstSub.addQuestion(questions);
        firstSub.setTitle("first subsection");
        ArrayList<Subsection> subs = new ArrayList<Subsection>();
        subs.add(firstSub);
        Section section = new Section();
        section.setTitle("first section");
        section.addSubsection(subs);
        ArrayList<Section> sect = new ArrayList<Section>();
        sect.add(section);
        QuestionPaper test = new QuestionPaper();
        test.setTestName("English Test");
        test.addSection(sect);
        test.setTestName("Testing english");
        FileManager manager = FileManager.getInstanceObject();
        manager.saveToFile(test);
        
       
//        //test
//        MultipleChoiceQuestion fourth = new MultipleChoiceQuestion();
//        fourth.setQuestionText("fourth");
//        Subsection currentSubSection =
//            manager.getTestRecord().getTestSection().get(0).getSubsection().get(0);
//        currentSubSection.addQuestion(fourth);
//        manager.saveToFile();
        //System.out.println(manager.readFromFile());
    }
}
